package cn.tedu.mybatis1.mapper;

import cn.tedu.mybatis1.pojo.entity.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface ProductMapper {
//    @Delete("delete from product where id=#{id}")
    int deleteById(int id);
//    @Insert("insert into product(title,price,stock) values " +
//            "(#{title},#{price},#{stock})")
    int insertProduct(Product product);
//    @Select("select id,title,price,stock from product")
    List<Product> selectManyProduct();
//    @Select("select id,title,price,stock from product where id=#{id};")
    Product selectSingleProduct(int id);
}
